#pragma once
#ifndef __GAME_TASK__INCLUDED__HH__
#define __GAME_TASK__INCLUDED__HH__

#include "LitPrerequisites.h"
#include "LitPointer.hpp"
#include "LitString.h"

namespace Lit
{
	class String;
	class LIT_API GameTask
	{
	public:
		GameTask( const String& name_, float delay_sec, bool only_once = true );
		virtual ~GameTask( );

		// returning true means task finished, mark it as consumed
		virtual bool execute( float dt ) = 0;

		const String& getName();
		float delay() const;
		bool isConsumed() const;
		bool isTriggerOnce() const;
		void _setConsumed( bool state );

	protected:
		bool mOnce;
		float mDelay;
		String mName;
		bool mConsumed;
	};
	typedef RefPtr<GameTask> GameTaskPtr;
};
#endif